const express = require('express');
const router = new express.Router();

/**
 * @param {Object} options
 * @param {} options.code 配件索赔分类编号
 * @param {} options.name 配件索赔分类名称
 * @throws {Error}
 * @return {Promise}
 */
router.get('/', async(req, res, next) => {
    const options = {
        code: req.query.code,
        name: req.query.name
    };
    const data = {
        message: 'message',
        payload: {
            content: [
                {
                    id: 'id37',
                    rowVersion: 'rowVersion',
                    code: 'code38',
                    name: 'name39',
                    status: 1,
                    createTime: '2019-05-07T07:42:10Z',
                    options: [
                        'update',
                        'abandon'
                    ]
                },
                {
                    id: 'id40',
                    rowVersion: 'rowVersion',
                    code: 'code41',
                    name: 'name42',
                    status: 1,
                    createTime: '2019-05-07T07:42:10Z',
                    options: [
                        'update',
                        'abandon'
                    ]
                }
            ],
            pageIndex: null,
            pageSize: null,
            sort: null,
            totalElements: 50,
            totalPages: null
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @throws {Error}
 * @return {Promise}
 */
router.post('/', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
router.post('/import', async(req, res, next) => {
    const options = {
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id Id
 * @throws {Error}
 * @return {Promise}
 */
router.get('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message',
        payload: {
            id: 'id43',
            rowVersion: 'rowVersion',
            code: 'code44',
            name: 'name45',
            status: 1,
            remark: 'remark',
            creatorName: 'creatorName46',
            createTime: '2019-05-07T07:42:10Z',
            modifierName: 'modifierName47',
            modifyTime: '2019-05-07T07:42:10Z',
            abandonerName: 'abandonerName48',
            abandonTime: '2019-05-07T07:42:10Z',
            options: [
                'update',
                'abandon'
            ]
        }
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.code 配件索赔分类编号
 * @param {} options.name 配件索赔分类名称
 * @throws {Error}
 * @return {Promise}
 */
router.get('/export', async(req, res, next) => {
    const options = {
        code: req.query.code,
        name: req.query.name
    };
    const data = {
        message: 'message',
        payload: 'payload'
    };
    res.json(data);
});
/**
 * @param {Object} options
 * @param {} options.id Id
 * @throws {Error}
 * @return {Promise}
 */
router.put('/:id/abandon', async(req, res, next) => {
    const options = {
        id: req.params.id
    };
    const data = {
        message: 'message'
    };
    res.json(data);
});
module.exports = router;
